package com.friendfeed.api;

import org.json.JSONException;
import org.json.JSONObject;

public class UserService {
    private String id;
    private String name;
    private String iconUrl;
    private String profileUrl;
    private String username;

    public UserService(JSONObject jsonObject) throws JSONException {
        id = jsonObject.getString("id");
        name = jsonObject.getString("name");
        iconUrl = jsonObject.getString("iconUrl");

        if (jsonObject.has("profileUrl")) {
            profileUrl = jsonObject.getString("profileUrl");
        }

        if (jsonObject.has("username")) {
            username = jsonObject.getString("username");
        }
    }

    public String getId() {
        return id;
    }

    public String getName() {
        return name;
    }

    public String getIconUrl() {
        return iconUrl;
    }

    public String getProfileUrl() {
        return profileUrl;
    }

    public String getUsername() {
        return username;
    }
}
